package com.igor.reporting.dao.issue;

import java.util.List;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.hibernate.Session;

import com.igor.reporting.entities.issue.Issue;

public class IssueDAOImpl implements IssueDAO {
	
	@Inject
	private Session session;

	public void add(Issue i) {
		if (i != null) {
			session.save(i);
		}
	}

	public void delete(Issue i) {
		if (i != null) {
			session.delete(i);
		}
	}

	public void update(Issue i) {
		if (i != null) {
			session.update(i);
		}
	}

	public Issue find(Long id) {
		return (Issue) session.load(Issue.class, id);
	}

	public List<Issue> findAll() {
		return session.createCriteria(Issue.class).list();
	}

}



